package cn.fuego.busrental.ui.Home;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import cn.fuego.busrental.R;

public class AreaAdapter extends BaseAdapter{

	private Context mcontext;
	private List<String> areaName=new ArrayList<String>();
	
	public AreaAdapter(Context mcontext,List<String> areaName)
	{
		this.mcontext=mcontext;
		this.areaName=areaName;
	}
	@Override
	public int getCount() {
		
		return areaName.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return areaName.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View view, ViewGroup parent) {
		LayoutInflater inflater = LayoutInflater.from(mcontext);
		view = inflater.inflate(R.layout.item_area, null);
		
		TextView t=(TextView) view.findViewById(R.id.area_name);
		t.setText(areaName.get(position));
		return view;
	}

}
